const compare = function (a: any, b: any) {
  if (typeof a == 'string') {
    return a.localeCompare(b, 'en');
  } else {
    return a > b;
  }

}

export default {
  flowColumns: [ //当前拦截ip
    {
      title: '序号',
      dataIndex: 'index',
      width: 160,
      key: 'index',
    },
    {
      title: '访问时间',
      dataIndex: 'createTime',
      width: 160,
      key: 'createTime',
      sorter: true,
      showSorterTooltip: false,
    },
    {
      title: '地区',
      dataIndex: 'province',
      key: 'time',
      width: 100,
    },
    {
      title: '来源',
      dataIndex: 'sourceUrlType',
      key: 'sourceUrlType',
      width: 240,
      ellipsis: true,//文字超过宽度都会出现省略号

    },
    {
      title: '用户名',
      dataIndex: 'userName',
      key: 'userName',

    },
    {
      title: '访问ip',
      dataIndex: 'accessIp',
      key: 'accessIp',
    }, {
      title: '访问时长',
      sorter: true,
      showSorterTooltip: false,
      dataIndex: 'pageAccessTime',
      key: 'pageAccessTime',
      width: 160,
    },
  ],
  tendencyColumns: [
    {
      title: '序号',
      dataIndex: 'index',
      width: 60,
      key: 'index',

    },
    {
      title: '日期时间',
      dataIndex: 'timeStr',
      key: 'timeStr',
      showSorterTooltip: false,
      sorter: (a: any, b: any) => compare(a.timeStr, b.timeStr),
    },
    {
      title: '浏览量(PV)',
      dataIndex: 'pvNum',
      key: 'pvNum',
      showSorterTooltip: false,
      sorter: (a: any, b: any) => compare(a.pvNum, b.pvNum),
    },
    {
      title: '访客数(UV)',
      dataIndex: 'uvNum',
      key: 'uvNum',
      ellipsis: true,//文字超过宽度都会出现省略号
      sorter: true, showSorterTooltip: false,
    },
    {
      title: 'IP数',
      dataIndex: 'ipNum',
      key: 'ipNum',
      sorter: true, showSorterTooltip: false,
    },
    {
      title: '跳出率',
      dataIndex: 'bounceRate',
      key: 'bounceRate',
      sorter: true, showSorterTooltip: false,
    }, {
      title: '平均访问时长',
      sorter: true, showSorterTooltip: false,
      dataIndex: 'averageVisitLength',
      key: 'averageVisitLength',
    },
  ],
  sourceStatisticsColumns: [
    {
      title: '序号',
      dataIndex: 'index',
      width: 60,
      key: 'index',

    },
    {
      title: '来源类型',
      dataIndex: 'type',
      key: 'type',
      showSorterTooltip: false,
      sorter: (a: any, b: any) => compare(a.type, b.type),
    },
    {
      title: '浏览量(PV)',
      dataIndex: 'pvNum',
      key: 'pvNum',
      showSorterTooltip: false,
      sorter: (a: any, b: any) => compare(a.pvNum, b.pvNum),
    },
    {
      title: '访客数(UV)',
      dataIndex: 'uvNum',
      key: 'uvNum',
      showSorterTooltip: false,
      ellipsis: true,//文字超过宽度都会出现省略号
      sorter: (a: any, b: any) => compare(a.uvNum, b.uvNum),
    },
    {
      title: 'IP数',
      dataIndex: 'ipNum',
      key: 'ipNum',
      showSorterTooltip: false,
      sorter: (a: any, b: any) => compare(a.ipNum, b.ipNum),
    },
    {
      title: '跳出率',
      dataIndex: 'bounceRate',
      key: 'bounceRate',
      showSorterTooltip: false,
      sorter: (a: any, b: any) => compare(a.bounceRate, b.bounceRate),
    }, {
      title: '平均访问时长',
      showSorterTooltip: false,
      sorter: (a: any, b: any) => compare(a.averageVisitLength, b.averageVisitLength),
      dataIndex: 'averageVisitLength',
      key: 'averageVisitLength',
    },
  ],
  visitedStatisticsColumns: [
    {
      title: '序号',
      dataIndex: 'index',
      width: 60,
      key: 'index',

    },
    {
      title: '页面URL',
      dataIndex: 'accessUrl',
      key: 'accessUrl',
      showSorterTooltip: false,
    },
    {
      title: '浏览量(PV)',
      dataIndex: 'pvNum',
      key: 'pvNum',
      showSorterTooltip: false,
      sorter: (a: any, b: any) => a.pvNum - b.pvNum,
    },
    {
      title: '访客数(UV)',
      dataIndex: 'uvNum',
      key: 'uvNum',
      ellipsis: true,//文字超过宽度都会出现省略号
      showSorterTooltip: false,
      sorter: (a: any, b: any) => a.uvNum - b.uvNum,
    },
    {
      title: '平均访问时长',
      showSorterTooltip: false,
      sorter: (a: any, b: any) => a.averagePageTime - b.averagePageTime,
      dataIndex: 'averagePageTime',
      key: 'averagePageTime',
    },
  ],
  netWorkColumns: [
    {
      title: '序号',
      dataIndex: 'index',
      width: 160,
      key: 'index',

    },
    {
      title: '页面URL',
      dataIndex: 'accessUrl',
      key: 'accessUrl',
      showSorterTooltip: false,
      width: 280,
    },
    {
      title: '浏览量(PV)',
      dataIndex: 'pvNum',
      key: 'pvNum',
      sorter: (a: any, b: any) => compare(a.pvNum, b.pvNum),
      width: 280,
    },
    {
      title: '访客数(UV)',
      dataIndex: 'uvNum',
      key: 'uvNum',
      ellipsis: true,//文字超过宽度都会出现省略号
      sorter: (a: any, b: any) => compare(a.uvNum, b.uvNum),
      width: 280,
    },
    {
      title: '平均访问时长',
      sorter: (a: any, b: any) => compare(a.averageVisitLength, b.averageVisitLength),
      dataIndex: 'averageVisitLength',
      key: 'averageVisitLength',
    },
  ],
  loyaltyStatictics: [
    {
      title: '序号',
      dataIndex: 'index',
      width: 160,
      key: 'index',
    },
    {
      title: '访问页面',
      dataIndex: 'duration',
      key: 'duration',
      showSorterTooltip: false,
      width: 280,
    },
    {
      title: '访问次数',
      dataIndex: 'num',
      key: 'num',
      sorter: (a: any, b: any) => compare(a.num, b.num),
      width: 280,
    },
    {
      title: '所占比例',
      dataIndex: 'percentage',
      key: 'percentage',
      ellipsis: true,//文字超过宽度都会出现省略号
      sorter: (a: any, b: any) => compare(a.percentage, b.percentage),
      width: 280,
    },
  ],
  contenRelease: {
    column: [
      {
        title: '栏目名称',
        dataIndex: 'name',
        key: 'name',
        showSorterTooltip: false,
        width: 280,
      },
      {
        title: '内容发布数',
        dataIndex: 'num',
        key: 'num',
        sorter: true, showSorterTooltip: false,
        width: 280,
      },

    ],
    user: [
      {
        title: '用户名',
        dataIndex: 'name',
        key: 'name',
        showSorterTooltip: false,
        width: 280,
      },
      {
        title: '真实姓名',
        dataIndex: 'realName',
        key: 'realName',
        showSorterTooltip: false,
        width: 280,
      },
      {
        title: '内容发布数',
        dataIndex: 'num',
        key: 'num',
        showSorterTooltip: false,
        sorter: (a: any, b: any) => compare(a.num, b.num),
        width: 280,
      },

    ],
    org: [
      {
        title: '组织',
        dataIndex: 'name',
        key: 'name',
        showSorterTooltip: false,
        width: 280,
      },
      {
        title: '内容发布数',
        dataIndex: 'num',
        key: 'num',
        showSorterTooltip: false,
        sorter: (a: any, b: any) => compare(a.num, b.num),
        width: 280,
      },

    ],
    site: [
      {
        title: '站点',
        dataIndex: 'name',
        key: 'name',
        showSorterTooltip: false,
        width: 280,
      },
      {
        title: '内容发布数',
        dataIndex: 'num',
        key: 'num',
        showSorterTooltip: false,
        sorter: (a: any, b: any) => compare(a.num, b.num),
        width: 280,
      },

    ],
  },
  contentData: {
    column: [
      {
        title: '栏目名称',
        dataIndex: 'name',
        key: 'name',
        showSorterTooltip: false,
        width: 280,
      },
      {
        title: '浏览量',
        dataIndex: 'views',
        key: 'views',
        sorter: true, showSorterTooltip: false,
        width: 280,
      },
      {
        title: '访客数',
        dataIndex: 'visitors',
        key: 'visitors',
        sorter: true, showSorterTooltip: false,
        width: 280,
      },
      {
        title: '点赞数',
        dataIndex: 'likes',
        key: 'likes',
        sorter: true, showSorterTooltip: false,
        width: 280,
      },
      {
        title: '评论数',
        dataIndex: 'comments',
        key: 'comments',
        sorter: true, showSorterTooltip: false,
        width: 280,
      },

    ],
    content: [
      {
        title: '内容标题',
        dataIndex: 'name',
        key: 'name',
        showSorterTooltip: false,
        width: 280,
      },
      {
        title: '发布时间',
        dataIndex: 'time',
        key: 'time',
        sorter: true,
        showSorterTooltip: false,
        width: 280,
      },
      {
        title: '浏览量',
        dataIndex: 'views',
        key: 'views',
        sortDirections: ['descend', 'ascend'],
        sorter: true, showSorterTooltip: false,
        width: 280,
      },
      {
        title: '访客数',
        dataIndex: 'visitors',
        key: 'visitors',
        sorter: true, showSorterTooltip: false,
        sortDirections: ['descend', 'ascend'],
        width: 280,
      },
      {
        title: '点赞数',
        dataIndex: 'likes',
        key: 'likes',
        sorter: true, showSorterTooltip: false,
        sortDirections: ['descend', 'ascend'],
        width: 280,
      },
      {
        title: '评论数',
        dataIndex: 'comments',
        key: 'comments',
        sorter: true, showSorterTooltip: false,
        sortDirections: ['descend', 'ascend'],
        width: 280,
      },

    ],

  },
  generalData: {
    sourceData: [
      {
        title: '来源网站',
        dataIndex: 'accessUrl',
        key: 'accessUrl',
        showSorterTooltip: false,
        width: 400,
      },
      {
        title: '浏览量（pv）',
        dataIndex: 'pvNum',
        key: 'pvNum',
        width: 280,
      },
      {
        title: '占比',
        dataIndex: 'percentage',
        key: 'percentage',
        width: 280,
      },
    ],
    entryData: [
      {
        title: '入口页面',
        dataIndex: 'accessUrl',
        key: 'accessUrl',
        width: 400,
      },
      {
        title: '浏览量（pv）',
        dataIndex: 'pvNum',
        key: 'pvNum',
        width: 280,
      },
      {
        title: '占比',
        dataIndex: 'percentage',
        key: 'percentage',
        width: 280,
      },
    ],
    areaData: [
      {
        title: '省份',
        dataIndex: 'provinceName',
        key: 'provinceName',
      },
      {
        title: '浏览量（pv）',
        dataIndex: 'num',
        key: 'num',
        width: 280,
      },
    ]
  },
  visitorStatistics: {
    netWork: [
      {
        title: '序号',
        dataIndex: 'index',
        key: 'index',
        width: 80,
      }, {
        title: '网络设备类型',
        dataIndex: 'name',
        key: 'name',
        width: 200,
      }, {
        title: '浏览量(PV)',
        dataIndex: 'pvNum',
        key: 'pvNum',
        sorter: true,
        showSorterTooltip: false,
        width: 200,
      }, {
        title: '访客数(UV)',
        dataIndex: 'uvNum',
        key: 'uvNum',
        sorter: true,
        showSorterTooltip: false,
        width: 200,
      }, {
        title: 'IP数',
        dataIndex: 'ipNum',
        key: 'ipNum',
        sorter: true,
        showSorterTooltip: false,
      }, {
        title: '跳出率',
        dataIndex: 'bounceRate',
        key: 'bounceRate',
        sorter: true,
        showSorterTooltip: false,
        width: 200,
      }, {
        title: '平均访问时长',
        dataIndex: 'averageVisitLength',
        key: 'averageVisitLength',
        sorter: true,
        showSorterTooltip: false,
      },
    ],
    netWorkInner: [
      {
        title: '序号',
        dataIndex: 'index',
        key: 'index',
        width: 128,
      }, {
        title: '网络设备类型',
        dataIndex: 'name',
        key: 'name',
        width: 200,
      }, {
        title: '浏览量(PV)',
        dataIndex: 'pvNum',
        key: 'pvNum',
        sorter: true,
        showSorterTooltip: false,
        width: 200,
      }, {
        title: '访客数(UV)',
        dataIndex: 'uvNum',
        key: 'uvNum',
        sorter: true,
        showSorterTooltip: false,
        width: 200,
      }, {
        title: 'IP数',
        dataIndex: 'ipNum',
        key: 'ipNum',
        sorter: true,
        showSorterTooltip: false,
      }, {
        title: '跳出率',
        dataIndex: 'bounceRate',
        key: 'bounceRate',
        sorter: true,
        showSorterTooltip: false,
        width: 200,
      }, {
        title: '平均访问时长',
        dataIndex: 'averageVisitLength',
        key: 'averageVisitLength',
        sorter: true,
        showSorterTooltip: false,
      },
    ],
    areaData: [
      {
        title: '序号',
        dataIndex: 'index',
        key: 'index',
        width: 80,
      }, {
        title: '地域',
        dataIndex: 'areaName',
        key: 'areaName',
        width: '16%',
      }, {
        title: '浏览量(PV)',
        dataIndex: 'pvNum',
        key: 'pvNum',
        sorter: true,
        showSorterTooltip: false,
        width: '16%',
      }, {
        title: '访客数(UV)',
        dataIndex: 'uvNum',
        key: 'uvNum',
        sorter: true,
        showSorterTooltip: false,
        width: '16%',
      }, {
        title: 'IP数',
        dataIndex: 'ipNum',
        key: 'ipNum',
        sorter: true,
        showSorterTooltip: false,
        width: '16%',
      }, {
        title: '跳出率',
        dataIndex: 'bounceRate',
        key: 'bounceRate',
        sorter: true,
        showSorterTooltip: false,
        width: '16%',
      }, {
        title: '平均访问时长',
        dataIndex: 'averageVisitLength',
        key: 'averageVisitLength',
        sorter: true,
        showSorterTooltip: false,
      },
    ],
    areaDataInner: [
      {
        title: '序号',
        dataIndex: 'index',
        key: 'index',
        width: 128,
      }, {
        title: '地域',
        dataIndex: 'areaName',
        key: 'areaName',
        width: '16%',
      }, {
        title: '浏览量(PV)',
        dataIndex: 'pvNum',
        key: 'pvNum',
        sorter: true,
        showSorterTooltip: false,
        width: '16%',
      }, {
        title: '访客数(UV)',
        dataIndex: 'uvNum',
        key: 'uvNum',
        sorter: true,
        showSorterTooltip: false,
        width: '16%',
      }, {
        title: 'IP数',
        dataIndex: 'ipNum',
        key: 'ipNum',
        sorter: true,
        showSorterTooltip: false,
        width: '16%',
      }, {
        title: '跳出率',
        dataIndex: 'bounceRate',
        key: 'bounceRate',
        sorter: true,
        showSorterTooltip: false,
        width: '16%',
      }, {
        title: '平均访问时长',
        dataIndex: 'averageVisitLength',
        key: 'averageVisitLength',
        sorter: true,
        showSorterTooltip: false,

      },
    ],

  }

}
